<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .father {
            width: 400px;
            background-color: pink;
        }

        .son {
            width: 100px;
            height: 300px;
            background-color: skyblue;
            float: left;
        }

        .clearfax::after,
        .clearfax::before {
            content: '';
            display: table;
        }

        .clearfax::after {
            clear: both;
        }
    </style>
</head>

<body>
<!-- 双伪元素清除法 固定操作-->
<div class="father clearfax">
    <div class="son"></div>
</div>
</body>

</html>